Skip to content

Build a KiteGeometry SystemDefinition from KPS3 and KPS4 and carry it in the log - #327

Draft
1-Bort-1 wants to merge 20 commits into
mainfrom
agent/322-one-kite-system-definition-across-the-ki
Draft

1-Bort-1 wants to merge 20 commits into
mainfrom
agent/322-one-kite-system-definition-across-the-ki

Conversation

@1-Bort-1

@1-Bort-1 1-Bort-1 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Depends-On: OpenSourceAWE/KiteGeometry.jl release after v0.1.0

Until now a KPS3 or KPS4 run described its system only through a segment count and a few settings. Nothing that reads a system definition could draw it, KiteViewers included. Now the model can describe itself as a KiteGeometry system definition: its points, the springs it integrates as segments, one tether and one winch. That definition can be saved in the log, so a viewer reading the log gets the topology the run actually integrated. KiteGeometry is re-exported, as KiteModels already does for KitePodModels, WinchModels and AtmosphericModels.

integrator = init!(kps4)
definition = system_definition(kps4)         # new
# ... simulate and log! ...
save_log(logger, definition, "sim_log")      # stores the definition in the log
KiteGeometry.definition(load_log("sim_log")) # reads it back

What the definition holds:

  • Points. One point per model point, named "1" upwards. Point 1 is the winch and is static.
  • Segments. For KPS4 these are the model's own spring list: 6 tether springs and 9 bridle springs, with their endpoints, rest lengths and nominal stiffness. The connectivity is therefore what the model integrates, not a second copy of the spring table. The bridle springs are massless, as KPS4 treats them, and keep the line diameter used for their drag. KPS3 has no spring list, so its segments join neighbouring points.
  • Masses. For KPS4 the KCU mass sits on the KCU point and the kite mass on points A–D. For KPS3 both sit on the last point. Tether mass comes from the segments' density and diameter.
  • Tether and winch. The tether runs from the winch to the KCU. Gear ratio and drum radius come from the settings.
  • Pose and stiffness. The pose is wherever the points are when the definition is built, so build it right after init!. The stiffness is the nominal value. The model only scales it below nominal during a start-up ramp.
  • Log format. Saving and reading the definition in a log are KiteGeometry's, so every model that builds a definition logs it the same way. The log stores it as JSON under the key topology. The definition carries its connectivity checksum, so a reader can tell when a log's states were recorded against a different topology.

This needs OpenSourceAWE/KiteGeometry.jl#50, which adds the log methods. Until a KiteGeometry release carries it, this branch's tests fail in CI against KiteGeometry 0.1.0. Once it is released, the KiteGeometry compat entry here rises to that version, with a minimal manifest resolve.

Where I'd push back:

  • The example is not literally unchanged. The torque-control reel-out example changes two lines: it builds the definition after init! and passes it to save_log. Its logger never sees the model, and KiteUtils' logger has nowhere to keep metadata, so an untouched script cannot carry the definition without global state. The simulation itself is unchanged.
  • The issue says this repo writes aero_force_b and tether_induced_force every step. It writes neither, so the KiteUtils state rename has nothing to change here.
  • The metadata's schema version comes from a constant KiteGeometry does not export. KiteGeometry's metadata type has only a positional constructor with no defaults. A keyword constructor with defaults would belong in KiteGeometry: Metadata has no keyword constructor, and AWESIO_VERSION is not public KiteGeometry.jl#49.

Dependencies: KiteGeometry 0.1.0, from the General registry. Both manifests come from a minimal resolve that started from main's. They gain the KiteGeometry entry and its JSON dependency. The 1.13 resolve ran under Julia 1.13.0, while main's 1.13 manifest was written under 1.13.1, so it also records julia_version 1.13.0 and the LibSSH2_jll that ships with 1.13.0.

Verification

  • Reproduced first: n/a, new feature.
  • test/test-system-definition.jl: the log testset errored against KiteGeometry 0.1.0 (MethodError, since no save_log takes a definition there) and passes against the KiteGeometry branch. 16/16 across 3 testsets (juliaserver, Julia 1.13.0, test project).
  • Acceptance against the KiteGeometry branch: examples/reel_out_4p_torque_control.jl runs to the end and logs 1800 rows of 11 points. KiteGeometry.definition on the loaded log gives 11 points (length(kps4.pos) is 11) and 15 segments whose endpoints equal the model's springs (true). The tether is segments 1–6, the drum radius 0.1615, and unit_stiffness matches at stiffness_factor 1.0.
  • test/test-aqua.jl 9/9 · docs build clean · up to date with main (b84950a, DSP 0.8.6 manifests).
  • GitHub CI: expected red until the KiteGeometry release. The commit before this change passed tests, docs, REUSE lint and link check.
  • REUSE lint: not run locally (no reuse on the box).
  • Benchmark: n/a, not on the step path.
  • Risk: a definition built after the run has started records the current pose, not the initial one. The docstring says to build it after init!.

Opened elsewhere

Opened by 1-Bort-1, an AI agent working for @1-Bart-1.
Closes #322 · task KiteModels.jl-322

1-Bort-1 and others added 3 commits September 30, 2026 16:26
system_definition(s) takes the points and the springs the model integrates;
topology_metadata(s) carries its structure document in a log under topology.
KiteGeometry is pinned through [sources] until it is registered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1-Bort-1 1-Bort-1 added agent:running Agent task state agent:ci Agent task state agent:review Agent task state and removed agent:running Agent task state agent:ci Agent task state labels Sep 30, 2026

@1-Bort-1 1-Bort-1 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review (advisory)

Verdict: APPROVE WITH COMMENTS · 3 inline, 0 off the diff

Good

  • Connectivity comes straight from s.springs, so there is no second copy of SPRINGS_INPUT, as the card says; checked against init_springs!/loop! in src/KPS4.jl
  • KCU extra mass is set.kcu_mass and not s.masses[segments+1], so the tether half-masses that loop! adds at KPS4.jl:484 are not counted twice
  • pos_ENU is an SVector field in KiteGeometry's Point, so the definition copies the pose and does not alias the live MVectors; confirmed in _structure.jl:73
  • unit_stiffness = axial_stiffness * length gives the stiffness per length that the schema field asks for (N); matches the set.axial_stiffness / L_0 construction
  • Both model methods share one 3-argument assembler, so there is one path from model to definition
  • Deferring connectivity_sha and to_json to KiteGeometry and not adding a third preimage writer is the right call; the reason is in the card
  • The round-trip testset protects the actual contract, a saved log parsing back to the same structure document

Not good

  • src/system_definition.jl:17 — All 9 kite springs get d_line and rho_tether, but KPS4 puts no mass on them (the kite points already hold all of set.mass), and several are canopy struts, not lines. Anything that sums segment mass will read a heavier system than the one that was simulated.
  • src/system_definition.jl:52 — A 7-argument positional Metadata(...) with two empty strings, a version literal and another empty string can't be reviewed from the diff. Keyword construction, or a KiteGeometry default, would name connectivity_sha and make the placeholder visible.
  • test/test-system-definition.jl:31 — This compares an immutable snapshot with spring endpoints that loop! never changes, so it passes whatever the step does. The next_step! and the assertion add runtime but protect nothing beyond a check before the step.
  • The [sources] pin to an unregistered KiteGeometry means ./bin/release cannot register KiteModels until the pin comes out; merging to main blocks releases until then
  • @reexport using KiteGeometry is only in the changelog; the card never gives a reason for pushing Point, Segment, Tether, Winch, Metadata into every user's namespace
  • The "1.0.0" and "structure_schema.yml" literals copy constants KiteGeometry owns and will drift when its schema version moves
  • stiffness_factor is left out of unit_stiffness, so the example (stiffness_factor=0.1) logs 10x the stiffness it actually simulated; the docstring says nothing about this
  • The 3-argument system_definition(s, segments, extra_masses) is a helper, but it becomes a documented method of an exported function
  • Prose in docs/src/functions.md and the changelog is hard-wrapped, against §6

claude, rubric CLEAN_CODE.md. A different lab from the implementer
on purpose: a reviewer sharing its blind spots would not flag its mistakes.

Comment thread src/system_definition.jl
Comment thread src/system_definition.jl Outdated
Comment thread test/test-system-definition.jl Outdated
@1-Bort-1 1-Bort-1 added agent:queued Agent task state and removed agent:review Agent task state labels Sep 30, 2026
@1-Bort-1

1-Bort-1 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member Author

Local full suite: PASS (2 min, Julia 1.13.0, one cell of the matrix)

@1-Bort-1 1-Bort-1 added agent:running Agent task state and removed agent:queued Agent task state labels Sep 30, 2026
…nwrapped prose

The bridle springs carry no mass in KPS4, so their segments get zero
density. The shared constructor becomes assemble_system_definition
instead of a third method of the exported system_definition. The
KPS4 test drops a next_step! that no assertion depended on and pins
unit_stiffness at the nominal value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1-Bort-1 1-Bort-1 added agent:ci Agent task state agent:review Agent task state agent:queued Agent task state agent:running Agent task state and removed agent:running Agent task state agent:ci Agent task state agent:review Agent task state agent:queued Agent task state labels Sep 30, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@1-Bort-1 1-Bort-1 added agent:review Agent task state and removed agent:ci Agent task state labels Oct 11, 2026
@1-Bort-1
1-Bort-1 requested a review from 1-Bart-1 October 11, 2026 20:05
@1-Bort-1 1-Bort-1 added agent:queued Agent task state and removed agent:review Agent task state agent:queued Agent task state labels Oct 11, 2026
1-Bort-1 and others added 2 commits October 12, 2026 00:56
Resolve examples/reel_out_4p_torque_control.jl: keep main's init! call without the
deprecated delta and stiffness_factor, and keep this branch's topology metadata.
Drop the deprecated delta from test-system-definition.jl's init! calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1-Bart-1

Copy link
Copy Markdown
Member

KiteGeometry.jl is released now.

1-Bort-1 and others added 3 commits October 12, 2026 14:04
Drop the [sources] pin now that KiteGeometry 0.1.0 is in General.
The log's topology is now the JSON that KiteGeometry.definition
reads, and the definition's connectivity_sha is filled in, so YAML is
no longer a direct dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The definition test reads the log back as JSON through KiteGeometry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1-Bort-1

Copy link
Copy Markdown
Member Author

Moved #327 onto the registered KiteGeometry 0.1.0 in 6034f6c, and the [sources] pin is gone. With 0.1.0, the log's topology is now JSON that KiteGeometry.definition reads back. The definition also carries its connectivity checksum. The Depends-On line is out of the card.

@1-Bart-1

Copy link
Copy Markdown
Member

save_log should get a method override, automatically adding the metadata. I think this method override should be in KiteGeometry.jl. Also a convenience method to easily get the system definition from a loaded log.

save_log(logger, system_definition(s), name) and KiteGeometry.definition(log)
now live in KiteGeometry, so topology_metadata goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1-Bort-1

Copy link
Copy Markdown
Member Author

Back in draft: its card waits on Depends-On: OpenSourceAWE/KiteGeometry.jl release after v0.1.0.

@1-Bort-1

Copy link
Copy Markdown
Member Author

Done. The save_log method and the log reader are in OpenSourceAWE/KiteGeometry.jl@b9583dd, whose pull request opens with this turn: save_log(logger, system, name) stores the definition, and KiteGeometry.definition(load_log(name)) reads it back. #327 switches to them in b44220a and drops its own helper. It is in draft until a KiteGeometry release carries the change.

@1-Bort-1

1-Bort-1 commented Oct 12, 2026 •

Copy link
Copy Markdown
Member Author

CI: test / Julia 1 - ubuntu-latest - x64 - pull_request failed on 38faff5ae.

https://github.com/OpenSourceAWE/KiteModels.jl/actions/runs/38356764958/job/115161368230

1-Bort-1 and others added 6 commits October 13, 2026 01:10
Main moved the default manifests to DSP 0.8.6. Both .defaults are main's plus a resolve that adds KiteGeometry; 1.13 was resolved under Julia 1.13.0, the newest on the box, so julia_version and LibSSH2_jll go back to 1.13.0's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:waiting-human Agent task state

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KiteModels.jl: a definition for KPS3 and KPS4

4 participants